function ccR_Mage_1()
    if ccrPlayerLevel() == 90 then Mage_Arcane_90v2() end
end

function Mage_Arcane_90v2()
	------------------
	-- Cast Power Word: Fortitude
	ccrCastBuffIfMissing("Mage Armor")
	 ---------------------
	 -- Cast Inner Fire
	ccrCastBuffIfMissing("Arcane Brilliance")
	 ---------------------
	-- Autoaccept LFR invite
	AcceptProposal();
	--------------------------

	
	-- Rotation
		if ccrPlayerIsInCombat() then
		-- CD
			if ccrTargetIsBoss()
				and SpellIsReady("Mirror Image")
					then
					ccrCast("Mirror Image")
					return
			end
			if ccrTargetIsBoss()
				and SpellIsReady("Arcane Power")
				and ccrPlayerHasDebuff("Arcane Charge")
				and ccrPlayerHasDebuffStacks("Arcane Charge", 4)
					then
					ccrCast("Arcane Power")
					return
			end
			-- Alter Time

			if ccrTargetIsBoss()
				and ccrPlayerHasBuff("Arcane Power")
				and SpellIsReady("Alter Time")
				and ccrPlayerHasDebuff("Arcane Charge")
				and ccrPlayerHasDebuffStacks("Arcane Charge", 4)
					then
					ccrCast("Alter Time")
					return
			end
			
		-- Rune Of Power
			if not ccrPlayerHasBuff("Rune of Power")
				and not ccrPlayerIsMoving()
				and (vLastHoG == nil or (GetTime() - vLastHoG > 3))
					then
					ccrCast("Rune of Power")
					vLastHoG = GetTime()
					if SpellIsTargeting() == 1 then CastAtLocation(Player:GetLocation()) end
					return
			end
		-- AOE
			if ccrPlayerCount(15) > 4
				then
				ccrCast("Arcane Explosion")
				return
			else
		-- Multidotting	
			if #tblPGetNearbyEnemies > 1
			and ccR_Mage_CheckForMissingBomb() then
			ccR_Mage_ApplyMissingBomb() return end end
	
			if ccrPlayerHasBuff("Profound Magic")
				and ccrPlayerHasDebuff("Arcane Charge")
				and ccrPlayerHasDebuffStacks("Arcane Charge", 3) 
				and ccrPlayerMana() > 93
					then
					ccrCastAttack("Arcane Blast")
					return
			end 
			if ccrPlayerHasDebuff("Arcane Charge") and ccrPlayerHasDebuffStacks("Arcane Charge", 4) and ccrPlayerHasBuff("Arcane Missiles!")
				then 
				ccrCastAttack("Arcane Missiles")
				return
			end
			if not (ccrTargetHasMyDebuff("Living Bomb") or ccrTargetHasMyDebuff("Nether Tempest") or ccrTargetHasMyDebuff("Frost Bomb"))
				then
				ccrCastAttack("Mage Bomb")
				return
			end
			if ccrPlayerHasDebuff("Arcane Charge") and ccrPlayerHasDebuffStacks("Arcane Charge", 4)
				and ccrPlayerMana() < 95
				then 
				ccrCastAttack("Arcane Barrage")
				return
			end
			if SpellIsReady("Presence of Mind")
				then
				ccrCast("Presence of Mind")
				return
			end
			if SpellIsReady("Arcane Blast")
				then
				ccrCastAttack("Arcane Blast")
				return
			end
			if ccrPlayerIsMoving()
				then
				ccrCastAttack("Arcane Barrage")
				return
			end
			if ccrPlayerIsMoving()
				then
				ccrCastAttack("Fire Blast")
				return
			end
			if ccrPlayerIsMoving()
				then
				ccrCastAttack("Ice Lance")
				return
			end
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
	end
end			